import sys, struct, time
file=open('Data/Log.dat','rb')
riga=struct.Struct('Qddd')
while True:
  temp = file.read(riga.size)	
  if temp:
    riga_lista=riga.unpack(temp)
    print "Utente:",riga_lista[0],
    print "login:",time.strftime('%H:%M:%S',time.localtime(riga_lista[1])),
    print "logout:",time.strftime('%H:%M:%S',time.localtime(riga_lista[2])),
    print "durata:",int(riga_lista[3]),"s"
  else: break

